<%@page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<%
			String basepath = request.getContextPath();
		%>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link href="<%=basepath%>/css/nomal.css" rel="stylesheet" type="text/css" />
		<script src="js/jquery-1.4.4.js" type="text/javascript"></script>
		<script language="javascript" type="text/javascript" src="<%=basepath%>/js/utilTool.js"></script>
		<script language="javascript" type="text/javascript" src="<%=basepath%>/js/validatorTool.js"></script>
<style type="text/css">
.mycolor {
	color: #FF0000;
}
</style>
<script type="text/javascript">
	function preStep() {
		//var valid = checkSupInfo(2);
	//	if(valid ==false){
		//	return false;
		//}
		document.forms[0].action = "<%=basepath %>/register/nopassEditPreStep?preStep=1";
		document.forms[0].submit();
	}
		
		//这里进行提交
	function nextStep() {
		var ErrMsg = checkField();
		if(trim(ErrMsg)!=""){
			alert(ErrMsg);
			return;
		}
		document.forms[0].action = "<%=basepath %>/register/nopassEditNextStep?nextStep=3";
		document.forms[0].submit();
	}
	
	function initCountryList(id){
		var url = "iframe:<%=basepath%>/register/initcountrylist?id="+id+"";
		dialog("", url,"500", "400", "","");
	}
	
	function trim(strToTrim) { 
	     result=strToTrim 
	     for (_i=0; _i<strToTrim.length; _i++) { 
	            if (strToTrim.charAt(_i)==" ") result=strToTrim.substr(_i+1) 
	            else _i=strToTrim.length 
	     } 
	     strToTrim=result 
	     for (_i=strToTrim.length-1; _i>=0; _i--) { 
	            if (strToTrim.charAt(_i)==" ") result=strToTrim.substr(0,_i) 
	            else _i=0 
	      } 
       return result 
	} 
	
	//必输项校验
	function checkField(){
		    var countrynameval = document.getElementById("countryname").value;
			var conaddressval = document.getElementById("conaddress").value;
			var ErrMsg = "";
			
			if(countrynameval == null ||trim(countrynameval)==""){
				ErrMsg += "国家/地区不允许为空!";
			}
			if(conaddressval== null || trim(conaddressval)==""){
				ErrMsg += "\n通讯地址不允许为空!";
			}
			return ErrMsg;
	}
</script>
</head>
	<body class="fullbody">
		<div id="content" class="content">
			<div class="">
				<b class="rtop"><b class="r1"></b><b class="r2"></b><b
					class="r3"></b><b class="r4"> </b> </b>
				<table cellpadding="0" cellspacing="0" border="0" width="980">
					<tr>
						<td class="leftmargin"></td>
						<td valign="top" align="center">
							<form method="post">
								<input type="hidden" name="src" value="${src}"/>
								<table cellpadding="0" cellspacing="0" border="0" width="650">
									<tr class="title">
										<td colspan="4"></td>
									</tr>
									<tr class="inputrow">
										<td class="ww">国家/地区：</td>
										<td class="wl">
											<input type="hidden" name="pk_country" id="country"
												 class="textstyle" value="${currentInfo.pk_country}" readOnly/>
											<input type="text" name="conutryName" id="countryname"
												value="${currentInfo.conutryName}" onclick="initCountryList('country')" class="textstyle"  readOnly/>
											<span class="needfill">*</span>
											<input type="hidden" name="bizaddress"
												value="${currentInfo.bizaddress}" class="textstyle" />
										</td>
									</tr>
									 <tr class="inputrow">
										<td class="ww">通讯地址：</td>
										<td class="wl">
											<input type="text" name="conaddress"
												value="${currentInfo.conaddress}" class="textstyle" />
											<span class="needfill">*</span>
										</td>
									</tr><tr class="inputrow">
										<td class="ww">邮政编码：</td>
										<td class="wl">
											<input type="text" name="zipcode" maxlength="6"
												value="${currentInfo.zipcode}" class="textstyle" />
										</td>
									</tr><tr class="inputrow">
										<td class="ww">Web网址：</td>
										<td class="wl">
											<input type="text" name="url"
												value="${currentInfo.url}" class="textstyle" />
										</td>
									</tr>
									<tr>
										<td colspan="4">
											&nbsp;
										</td>
									</tr>
									<tr class="buttonrow">
										<td align="right" colspan="4">
											<input type="button" value="上一步" onclick="preStep();"
												class="btnscs" />
											&nbsp;&nbsp;
											<input type="button" value="下一步" onclick="nextStep();"
												class="btnscs" />
										</td>
									</tr>
								</table>
							</form>
						</td>
					</tr>
				</table>
				<div id="message" class="mycolor">
					<c:out value="${ERROR_MESSAGE}"></c:out>
				</div>
				<b class="rbottom">
					<b class="r4"></b>
					<b class="r3"></b>
					<b class="r2"></b>
					<b class="r1"> </b> 
				</b>
			</div>
		</div>
	</body>